//
//  ILGAnimationListVC.m
//  ILGDemo
//
//  Created by zhangtongle-Pro on 2017/10/23.
//  Copyright © 2017年 Happy. All rights reserved.
//

#import "ILGAnimationListVC.h"
#import "ILGAnimationDisplayVC.h"

@interface ILGAnimationListVC ()
@property (nonatomic, strong) NSMutableArray *animationNameArr;
@end

@implementation ILGAnimationListVC

- (void)viewDidLoad {
    [super viewDidLoad];

    [self initData];
    [self createUI];
}

- (void)dealloc {
    NSLog(@"%s", __func__);
}


#pragma mark - data

- (void)initData {
    self.animationNameArr = @[@"画M曲线", @"旋转动画", @"缩放动画", @"飘心", @"音频波动", @"动画 6", @"画曲线"].mutableCopy;
}


#pragma mark - UI

- (void)createUI {
    [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"reuseIdentifier"];
}


#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.animationNameArr.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"reuseIdentifier" forIndexPath:indexPath];
    cell.textLabel.text = self.animationNameArr[indexPath.row];
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    int animationType = (int)indexPath.row;
    ILGAnimationDisplayVC *vc = [[ILGAnimationDisplayVC alloc] init];
    vc.animationType = animationType;
    vc.title = self.animationNameArr[indexPath.row];
    [self.navigationController pushViewController:vc animated:YES];
}


#pragma mark - event


@end
